/**
 * @author 陈泰来
 * @version V1.0
 * @Project echo-java-base
 * @Title
 * @Description *
 * @Package designmodel.factorymodel.methodFac.client
 * @date 2020/10/27 1:37 下午
 * @Copyright:学如逆水行舟，不进则退 .
 */
package designmodel.factorymodel.methodFac.client;

import designmodel.factorymodel.methodFac.factory.AbstractPhoneFactory;
import designmodel.factorymodel.methodFac.factory.concret.IphoneFactory;
import designmodel.factorymodel.methodFac.factory.concret.XiaomiFactory;
import designmodel.factorymodel.simpleFac.model.Phone;

public class AbstractClientTest {
    public static void main(String[] args) {
        //不许要再指定手机的类型，而是直接获取到对应产品的工厂实例，即可生产对应的产品。

        //理解: 要开多个工厂，而不是一个工厂根据客户需要的类型去提供产品

        AbstractPhoneFactory iphoneFactory = new IphoneFactory();
        Phone iphone = iphoneFactory.makePhone();
        iphone.make();

        AbstractPhoneFactory miphone = new XiaomiFactory();
        Phone miPhone = miphone.makePhone();
        miPhone.make();
    }

}
